<template>
	<view>
		<view class="content roundrect" v-for="(item,key) in dataList" :key="key" @click="toCreatorIndex(item.id)">
			<view class="album">
				<u-image :src="item.avatar" shape="circle" :lazy-load="true" width="80rpx" height="80rpx">
				</u-image>
				<view class="author">
					<view class="info">
						<text class="word">{{item.word}}</text>
						<view class="number">
							<u-icon :color="iconColor" space="4" name="photo-fill" labelSize="20" :label="item.works"
								:size="iconSize"></u-icon>
							<u-icon :color="iconColor" space="4" name="heart-fill" labelSize="20" :label="item.like"
								:size="iconSize"></u-icon>
							<view class="hot">
								<u-icon :color="iconColor" space="0" name="/static/icon/hot_blue_fill.png" labelSize="20"
									:label="item.power" size="40"></u-icon>
							</view>
						</view>
					</view>
				</view>
			</view>
			<view class="images">
				<u-image :radius="10" :lazyLoad="true" v-for="(item,index) in item.hot_works" :key="index"
					:src="item.path" :lazy-load="true" width="235rpx" height="400rpx">
				</u-image>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: "writer-item",
		props: ["dataList"],
		data() {
			return {
				iconColor: "#536BF6",
				iconSize: 36,
			};
		},
		methods: {
			// 跳转作者主页
			toCreatorIndex(id) {
				uni.navigateTo({
					url: '/pages/creator/index?id=' + id
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.images {
		display: flex;
		justify-content: space-between;
	}

	.roundrect {
		border-radius: $uni-img-radius;
		box-shadow: 0 0 20rpx #dfdfdf;
		margin-top: 20rpx;
		padding: 10rpx;
	}

	.album {
		display: flex;
		// justify-content:space-around;
		align-items: flex-start;

		.author {
			margin-left: 15rpx;
			height: 100rpx;

			.info {
				margin-top: -10rpx;

				.word {
					font-size: 22rpx;
					padding-left: 4rpx;
				}

				.number {
					display: flex;
					width: 300rpx;
					justify-content: space-between;

					.hot {
						margin-top: -4rpx;
					}
				}
			}

		}

	}
</style>
